<!DOCTYPE HTML>
{% load i18n static %}
{% get_current_language as LANGUAGE_CODE %}
<html>
<head>
    <title>{% block title %}Keg Problems{% endblock %}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="keywords" content="">
    <style type="text/css">
        html {
            width: 100%;
        }

        body {
            font-family: 'Open Sans', sans-serif;
            font-size: 14px;
            width: 100%;
            text-align: left;
        }

        td.logo {
          width: 140px;
        }

        .page {
            width: 660px;
            margin-top: 0;
            margin-bottom: 0;
            margin-right: auto;
            margin-left: auto;
            background-color: #ffffff;
            padding-top: 30px;
            padding-bottom: 30px;
            padding-right: 40px;
            padding-left: 40px;
        }

        .container {
            width: 100%;
        }

        p {
            /* text-indent:28px; */
        }

        h1, h2 {
            text-align: center;
        }

        h1 {
            font-size: 50px;
        }

        h2 {
            font-size: 28px;
        }

        th {
            font-size: 15px;
        }

        table, tr, th, td {
            padding: 0;
            margin: 0;
        }

        table {
            width: 100%;
            border-collapse:collapse;
            /* background-color: #b6306e; */
        }


        table.contract_code td, table.p td {
            padding: 15px 1px;
        }

        table.price th, table.price td {
            padding: 10px 1px 5px;
        }

        table.desc th {
            padding: 15px 1px 15px;
        }

        table.equipment_list_contract tbody tr.list_header th {
            background-color: #63B8FF;
            text-align: center;
        }

        table.equipment_list_contract th, table.equipment_list_contract td {
            border: solid black;
            border-width:1px;
            padding: 5px;
            font-size: 12px;
        }

        table.summary th, table.summary td {
            border: solid black;
            border-top-width:1px;
            border-right-width:1px;
            border-bottom-width:1px;
            border-left-width:1px;
            padding: 5px;
        }

        table.summary thead th {
            text-align: center;
        }

        table.notes th {
            padding: 15px 1px 5px;
            text-align: left;
        }
        table.notes td {
            padding: 3px;
        }


        .form-inline .form-group {
            display: inline-block;
            margin-bottom: 0;
            vertical-align: middle;
            margin-right: 50px;
        }

    </style>
</head>
<body>
    <div class="page">
        <div class="container">
            <h1>啤酒桶问题反馈统计</h1>
            <form type="get" action="{{ request.path }}" class="form-inline">
                <input type="hidden" name="code" value="cbwi2cqevq1eivi3qevbe">
                <div class="form-group">
                    <label for="date_start">开始时间：</label>
                    <input type="date" name="date_start" value="{{ request.GET.date_start }}" id="date_start">
                </div>
                <div class="form-group">
                    <label for="date_end">截止时间：</label>
                    <input type="date" name="date_end" value="{{ request.GET.date_end }}" id="date_end">
                </div>
                <button type="submit">统计</button>
            </form>
            <table class="desc">
                <tbody>
                    <tr>
                        <th>汇总信息: 已统计到 {{ total_count|default_if_none:'0' }} 起，{{ total_kegs|default_if_none:'0' }}个</th>
                    </tr>
                </tbody>
            </table>
            <table class="equipment_list_contract">
                <tbody>
                    <tr class="list_header">
                        <th>No.</th>
                        <th>反馈日期</th>
                        <th>产品名称</th>
                        <th>反馈内容</th>
                        <th>渠道</th>
                        <th>数量</th>
                        <th>附件</th>
                    </tr>
                    {% for item in objects %}
                    <tr>
                        <td style="text-align:center;width:25px;">{{ forloop.counter }}</td>
                        <td style="text-align:right;width:65px;">{{ item.feedback_date|date:'Y-m-d' }}</td>
                        <td style="text-align:center;width:100px;">{{ item.package_group.name }}</td>
                        <td>{{ item.content }}</td>
                        <td style="text-align:center;width:60px;">{{ item.channels }}</td>
                        <td style="text-align:center;width:35px;">{{ item.amount }}</td>
                        <td style="text-align:center;width:50px;">
                            {% for a in item.attachments %}
                                <a href="{{ a.file.url }}"><p>附件{{ forloop.counter }}</p></a>
                            {% endfor %}
                        </td>
                    </tr>{% endfor %}
                </tbody>
            </table>
        </div>
    </div>
    <div class="footer" style="text-align:center;">
        <p></p>
    </div>
</body>
</html>

